package com.zkld.controller;

public class Test {

    public String name;

    public int age;

    @Override
    public String toString() {
        return "Test{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    public void test(String name){
    }

    public static void main(String[] args) {

        Test test1 = new Test();
        test1.name = "tom";
        test1.age = 10;

        Test test2 = new Test();
        test2.name = "jack";
        test2.age = 11;

        change(test1,test2);

        System.out.println(test1);
        System.out.println(test2);
    }

    public static void change(Test test1,Test test2){
        Test index = test1;
        test1 = test2;
        test2 = index;
    }
}

